package cn.syy.fallback;

import cn.syy.feign.AppLoginFeignClient;
import cn.syy.pojo.param.RegisterSaveLoginParam;
import cn.syy.result.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class AppLoginFeignClientFallbackFactory implements FallbackFactory<AppLoginFeignClient> {
    @Override
    public AppLoginFeignClient create(Throwable cause) {
        cause.printStackTrace(); // 有异常的时候打印异常
       return  new AppLoginFeignClient() {
           @Override
           public R<Void> save(RegisterSaveLoginParam registerSaveLoginParam) {
               return R.error();
           }
       };
    }
}
